\(\int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx\) [574]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 95 \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{3/2} d}-\frac {\sec (c+d x) (b-a \tan (c+d x))}{2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2} \]

[Out]

-1/2*arctanh((b*cos(d*x+c)-a*sin(d*x+c))/(a^2+b^2)^(1/2))/(a^2+b^2)^(3/2)/d-1/2*sec(d*x+c)*(b-a*tan(d*x+c))/(a
^2+b^2)/d/(a+b*tan(d*x+c))^2

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.24, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3593, 735, 739, 212} \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\sec (c+d x) \text {arctanh}\left (\frac {b-a \tan (c+d x)}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right )}{2 d \left (a^2+b^2\right )^{3/2} \sqrt {\sec ^2(c+d x)}}-\frac {\sec (c+d x) (b-a \tan (c+d x))}{2 d \left (a^2+b^2\right ) (a+b \tan (c+d x))^2} \]

[In]

Int[Sec[c + d*x]^3/(a + b*Tan[c + d*x])^3,x]

[Out]

-1/2*(ArcTanh[(b - a*Tan[c + d*x])/(Sqrt[a^2 + b^2]*Sqrt[Sec[c + d*x]^2])]*Sec[c + d*x])/((a^2 + b^2)^(3/2)*d*
Sqrt[Sec[c + d*x]^2]) - (Sec[c + d*x]*(b - a*Tan[c + d*x]))/(2*(a^2 + b^2)*d*(a + b*Tan[c + d*x])^2)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 735

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-(d + e*x)^(m + 1))*(-2*a*e + (2*c
*d)*x)*((a + c*x^2)^p/(2*(m + 1)*(c*d^2 + a*e^2))), x] - Dist[4*a*c*(p/(2*(m + 1)*(c*d^2 + a*e^2))), Int[(d +
e*x)^(m + 2)*(a + c*x^2)^(p - 1), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ[m + 2*p + 2
, 0] && GtQ[p, 0]

Rule 739

Int[1/(((d_) + (e_.)*(x_))*Sqrt[(a_) + (c_.)*(x_)^2]), x_Symbol] :> -Subst[Int[1/(c*d^2 + a*e^2 - x^2), x], x,
 (a*e - c*d*x)/Sqrt[a + c*x^2]] /; FreeQ[{a, c, d, e}, x]

Rule 3593

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[d^(2*
IntPart[m/2])*((d*Sec[e + f*x])^(2*FracPart[m/2])/(b*f*(Sec[e + f*x]^2)^FracPart[m/2])), Subst[Int[(a + x)^n*(
1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && NeQ[a^2 + b^2, 0] &&
 !IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\sec (c+d x) \text {Subst}\left (\int \frac {\sqrt {1+\frac {x^2}{b^2}}}{(a+x)^3} \, dx,x,b \tan (c+d x)\right )}{b d \sqrt {\sec ^2(c+d x)}} \\ & = -\frac {\sec (c+d x) (b-a \tan (c+d x))}{2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}+\frac {\sec (c+d x) \text {Subst}\left (\int \frac {1}{(a+x) \sqrt {1+\frac {x^2}{b^2}}} \, dx,x,b \tan (c+d x)\right )}{2 b \left (a^2+b^2\right ) d \sqrt {\sec ^2(c+d x)}} \\ & = -\frac {\sec (c+d x) (b-a \tan (c+d x))}{2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}-\frac {\sec (c+d x) \text {Subst}\left (\int \frac {1}{1+\frac {a^2}{b^2}-x^2} \, dx,x,\frac {1-\frac {a \tan (c+d x)}{b}}{\sqrt {\sec ^2(c+d x)}}\right )}{2 b \left (a^2+b^2\right ) d \sqrt {\sec ^2(c+d x)}} \\ & = -\frac {\text {arctanh}\left (\frac {b \left (1-\frac {a \tan (c+d x)}{b}\right )}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right ) \sec (c+d x)}{2 \left (a^2+b^2\right )^{3/2} d \sqrt {\sec ^2(c+d x)}}-\frac {\sec (c+d x) (b-a \tan (c+d x))}{2 \left (a^2+b^2\right ) d (a+b \tan (c+d x))^2} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.49 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.39 \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=\frac {\left (a^2+b^2\right ) (-b \cos (c+d x)+a \sin (c+d x))+2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right ) (a \cos (c+d x)+b \sin (c+d x))^2}{2 (a-i b)^2 (a+i b)^2 d (a \cos (c+d x)+b \sin (c+d x))^2} \]

[In]

Integrate[Sec[c + d*x]^3/(a + b*Tan[c + d*x])^3,x]

[Out]

((a^2 + b^2)*(-(b*Cos[c + d*x]) + a*Sin[c + d*x]) + 2*Sqrt[a^2 + b^2]*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a
^2 + b^2]]*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(2*(a - I*b)^2*(a + I*b)^2*d*(a*Cos[c + d*x] + b*Sin[c + d*x])
^2)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(190\) vs. \(2(87)=174\).

Time = 17.40 (sec) , antiderivative size = 191, normalized size of antiderivative = 2.01

method result size
derivativedivides \(\frac {-\frac {2 \left (-\frac {\left (a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a \left (a^{2}+b^{2}\right )}-\frac {b \left (a^{2}-2 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a^{2}+b^{2}\right ) a^{2}}-\frac {\left (a^{2}-2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a^{2}+b^{2}\right ) a}+\frac {b}{2 a^{2}+2 b^{2}}\right )}{{\left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}^{2}}+\frac {\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{d}\) \(191\)
default \(\frac {-\frac {2 \left (-\frac {\left (a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a \left (a^{2}+b^{2}\right )}-\frac {b \left (a^{2}-2 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 \left (a^{2}+b^{2}\right ) a^{2}}-\frac {\left (a^{2}-2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 \left (a^{2}+b^{2}\right ) a}+\frac {b}{2 a^{2}+2 b^{2}}\right )}{{\left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}^{2}}+\frac {\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}}{d}\) \(191\)
risch \(\frac {{\mathrm e}^{i \left (d x +c \right )} \left (i a \,{\mathrm e}^{2 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}-i a +b \right )}{\left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )^{2} \left (-i a +b \right ) d \left (i a +b \right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{3}+i a \,b^{2}-a^{2} b -b^{3}}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{2 \left (a^{2}+b^{2}\right )^{\frac {3}{2}} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{3}+i a \,b^{2}-a^{2} b -b^{3}}{\left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )}{2 \left (a^{2}+b^{2}\right )^{\frac {3}{2}} d}\) \(224\)

[In]

int(sec(d*x+c)^3/(a+b*tan(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(-2*(-1/2*(a^2+2*b^2)/a/(a^2+b^2)*tan(1/2*d*x+1/2*c)^3-1/2*b*(a^2-2*b^2)/(a^2+b^2)/a^2*tan(1/2*d*x+1/2*c)^
2-1/2*(a^2-2*b^2)/(a^2+b^2)/a*tan(1/2*d*x+1/2*c)+1/2*b/(a^2+b^2))/(tan(1/2*d*x+1/2*c)^2*a-2*b*tan(1/2*d*x+1/2*
c)-a)^2+1/(a^2+b^2)^(3/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 294 vs. \(2 (88) = 176\).

Time = 0.27 (sec) , antiderivative size = 294, normalized size of antiderivative = 3.09 \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=\frac {{\left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right )} \sqrt {a^{2} + b^{2}} \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 2 \, {\left (a^{2} b + b^{3}\right )} \cos \left (d x + c\right ) + 2 \, {\left (a^{3} + a b^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{6} + a^{4} b^{2} - a^{2} b^{4} - b^{6}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{5} b + 2 \, a^{3} b^{3} + a b^{5}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{4} b^{2} + 2 \, a^{2} b^{4} + b^{6}\right )} d\right )}} \]

[In]

integrate(sec(d*x+c)^3/(a+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/4*((2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)*sqrt(a^2 + b^2)*log(-(2*a*b*cos(d*x
+ c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 - b^2 + 2*sqrt(a^2 + b^2)*(b*cos(d*x + c) - a*sin(d*x +
 c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)) - 2*(a^2*b + b^3)*cos(d*x + c) + 2
*(a^3 + a*b^2)*sin(d*x + c))/((a^6 + a^4*b^2 - a^2*b^4 - b^6)*d*cos(d*x + c)^2 + 2*(a^5*b + 2*a^3*b^3 + a*b^5)
*d*cos(d*x + c)*sin(d*x + c) + (a^4*b^2 + 2*a^2*b^4 + b^6)*d)

Sympy [F]

\[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=\int \frac {\sec ^{3}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{3}}\, dx \]

[In]

integrate(sec(d*x+c)**3/(a+b*tan(d*x+c))**3,x)

[Out]

Integral(sec(c + d*x)**3/(a + b*tan(c + d*x))**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 326 vs. \(2 (88) = 176\).

Time = 0.31 (sec) , antiderivative size = 326, normalized size of antiderivative = 3.43 \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\frac {2 \, {\left (a^{2} b - \frac {{\left (a^{3} - 2 \, a b^{2}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {{\left (a^{2} b - 2 \, b^{3}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {{\left (a^{3} + 2 \, a b^{2}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{6} + a^{4} b^{2} + \frac {4 \, {\left (a^{5} b + a^{3} b^{3}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, {\left (a^{6} - a^{4} b^{2} - 2 \, a^{2} b^{4}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {4 \, {\left (a^{5} b + a^{3} b^{3}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {{\left (a^{6} + a^{4} b^{2}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^3/(a+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

-1/2*(2*(a^2*b - (a^3 - 2*a*b^2)*sin(d*x + c)/(cos(d*x + c) + 1) - (a^2*b - 2*b^3)*sin(d*x + c)^2/(cos(d*x + c
) + 1)^2 - (a^3 + 2*a*b^2)*sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/(a^6 + a^4*b^2 + 4*(a^5*b + a^3*b^3)*sin(d*x +
 c)/(cos(d*x + c) + 1) - 2*(a^6 - a^4*b^2 - 2*a^2*b^4)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 4*(a^5*b + a^3*b^
3)*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + (a^6 + a^4*b^2)*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) + log((b - a*sin
(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a*sin(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/(a^
2 + b^2)^(3/2))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (88) = 176\).

Time = 0.61 (sec) , antiderivative size = 221, normalized size of antiderivative = 2.33 \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\frac {\log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac {3}{2}}} - \frac {2 \, {\left (a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2} b\right )}}{{\left (a^{4} + a^{2} b^{2}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}^{2}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)^3/(a+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

-1/2*(log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(
a^2 + b^2)))/(a^2 + b^2)^(3/2) - 2*(a^3*tan(1/2*d*x + 1/2*c)^3 + 2*a*b^2*tan(1/2*d*x + 1/2*c)^3 + a^2*b*tan(1/
2*d*x + 1/2*c)^2 - 2*b^3*tan(1/2*d*x + 1/2*c)^2 + a^3*tan(1/2*d*x + 1/2*c) - 2*a*b^2*tan(1/2*d*x + 1/2*c) - a^
2*b)/((a^4 + a^2*b^2)*(a*tan(1/2*d*x + 1/2*c)^2 - 2*b*tan(1/2*d*x + 1/2*c) - a)^2))/d

Mupad [B] (verification not implemented)

Time = 6.93 (sec) , antiderivative size = 260, normalized size of antiderivative = 2.74 \[ \int \frac {\sec ^3(c+d x)}{(a+b \tan (c+d x))^3} \, dx=\frac {\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-2\,b^2\right )}{a\,\left (a^2+b^2\right )}-\frac {b}{a^2+b^2}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a^2+2\,b^2\right )}{a\,\left (a^2+b^2\right )}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^2-2\,b^2\right )}{a^2\,\left (a^2+b^2\right )}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2-4\,b^2\right )+a^2-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {\mathrm {atanh}\left (\frac {\left (2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {2\,a^2\,b+2\,b^3}{a^2+b^2}\right )\,\left (\frac {a^2}{2}+\frac {b^2}{2}\right )}{{\left (a^2+b^2\right )}^{3/2}}\right )}{d\,{\left (a^2+b^2\right )}^{3/2}} \]

[In]

int(1/(cos(c + d*x)^3*(a + b*tan(c + d*x))^3),x)

[Out]

((tan(c/2 + (d*x)/2)*(a^2 - 2*b^2))/(a*(a^2 + b^2)) - b/(a^2 + b^2) + (tan(c/2 + (d*x)/2)^3*(a^2 + 2*b^2))/(a*
(a^2 + b^2)) + (b*tan(c/2 + (d*x)/2)^2*(a^2 - 2*b^2))/(a^2*(a^2 + b^2)))/(d*(a^2*tan(c/2 + (d*x)/2)^4 - tan(c/
2 + (d*x)/2)^2*(2*a^2 - 4*b^2) + a^2 - 4*a*b*tan(c/2 + (d*x)/2)^3 + 4*a*b*tan(c/2 + (d*x)/2))) + atanh(((2*a*t
an(c/2 + (d*x)/2) - (2*a^2*b + 2*b^3)/(a^2 + b^2))*(a^2/2 + b^2/2))/(a^2 + b^2)^(3/2))/(d*(a^2 + b^2)^(3/2))